
{{ $site:=site }}
<!-- 查询 content 列表 -->
{{ $selectList := selectList "content" .q .pageNo 20 "* FROM content WHERE status in (1,2) order by status desc,sortNo desc"  }}

<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<title>{{ $site.Title }}</title>
	<meta name="description" content="{{ $site.Description }}" />
	<meta name="keyword" content="{{ $site.Keyword }}" />


	{{template "bodystart.html" }}
	<input type="hidden" id="search-q" value="{{$.q}}" />


	{{ range $k,$v := $selectList.Data }}	



<article id="{{$v.Id}}" class="{{$v.Id}} post type-post status-publish format-standard hentry category-uncategorized" itemtype="https://schema.org/CreativeWork" itemscope>
	<div class="inside-article">
					<header class="entry-header">
				<h2 class="entry-title" itemprop="headline"><a href="{{basePath}}{{ trimPrefixSlash $v.Id}}" rel="bookmark">{{$v.Title}}</a></h2>		
				<div class="entry-meta">
			<span class="posted-on">
				<time class="entry-date published" datetime="{{ slice .UpdateTime 0 10 }}" itemprop="datePublished">{{ slice $v.UpdateTime 0 10 }}</time></span> 
				<span class="byline">
					 <span class="author vcard" itemprop="author" itemtype="https://schema.org/Person" itemscope><a class="url fn n" href="{{basePath}}{{ trimSlash .CategoryID }}" title="查看{{ $v.CategoryName }}栏目的所有文章" rel="author" itemprop="url"><span class="author-name" itemprop="name">{{ $v.CategoryName }}</span></a></span></span> 		</div>
					</header>
			
			<div class="entry-summary" itemprop="text">
				 {{ .Summary }} &#8230; <a title="{{$v.Title}}" class="read-more" href="{{basePath}}{{ trimPrefixSlash $v.Id}}" aria-label="Read more about xuperchian">阅读更多</a>
			</div>
		</div>
</article>
{{end}}



{{if gt $selectList.Page.PageCount 1}}
		<nav id="nav-below" class="paging-navigation" aria-label="归档页面">
			<div class="nav-links">
			{{$currPageNo := $selectList.Page.PageNo}}
			{{if lt $currPageNo 1}}
			  {{$currPageNo = 1}}
			{{end}}
			{{if gt $currPageNo $selectList.Page.PageCount }}
			   {{$currPageNo = $selectList.Page.PageCount}}
			{{end}}
		  
			{{if gt $currPageNo 1}}
			  <a class="prev page-numbers" href="{{basePath}}page/{{ addInt $currPageNo -1 }}?q={{.q}}"><span aria-hidden="true">&larr;</span> 上一页</a>
			{{end}}


			{{ range $index, $value := (seq 1 $selectList.Page.PageCount) }}
				{{ if eq $currPageNo $value }}
				<span aria-current="page" class="page-numbers current"><span class="screen-reader-text">页面</span>{{$value}}</span>
				{{else}}
				<a class="page-numbers" href="{{basePath}}page/{{$value}}?q={{$.q}}"><span class="screen-reader-text">页面</span>{{$value}}</a>
				{{end}}  
			{{ end }}

			{{if lt $currPageNo $selectList.Page.PageCount}}
			  <a class="next page-numbers" href="{{basePath}}page/{{ addInt $currPageNo 1 }}?q={{$.q}}">下一页 <span aria-hidden="true">&rarr;</span></a>
			{{end}}  
			</div>		
		</nav>
{{end}}

{{template "bodyend.html" }}

<script>
	var search=document.getElementById("search-q").value;
	if(search){
		document.getElementById("search-field-q").value=search;
	}
</script>